package com.naiterui.ehp.bp.domain.record;

import static javax.persistence.GenerationType.IDENTITY;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;

import lombok.ToString;

/**
 * 医生备案结构关系实体
 *
 * @author Amber
 * @since 1.0.0
 */
@ToString
@Entity
@Table(name = "dr_record_relation")
public class DrRecordRelation implements Serializable {
    /**
     * 字段或域定义：<code>serialVersionUID</code>
     */
    private static final long serialVersionUID = 6453658207955964907L;
    /**
     * 主键：<code>id</code>
     */
    private Long id;
    /**
     * 医生id：<code>doctorId</code>
     */
    private Long doctorId;
    /**
     * 机构id：<code>agencyId</code>
     */
    private Integer agencyId;

    /**
     * 创建时间：<code>createdAt</code>
     */
    private Date createdAt;

    /**
     * 创建人
     */
    private String createdBy;

    /**
     * 修改时间：<code>changedAt</code>
     */
    private Date changedAt;

    /**
     * 修改人
     */
    private String changedBy;

    private Integer version;

    public DrRecordRelation() {
    }

    public DrRecordRelation(Long doctorId, Integer agencyId) {
        this.doctorId = doctorId;
        this.agencyId = agencyId;
        this.createdAt = new Date();
        this.createdBy = "system";
    }

    /**
     * @return Long 取得域 id 的方法。
     */
    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }

    /**
     * @param id 对域 id 的设置方法.
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @return Long 取得域 doctorId 的方法。
     */
    @Column(name = "doctor_id", nullable = false)
    public Long getDoctorId() {
        return this.doctorId;
    }

    /**
     * @param doctorId 对域 doctorId 的设置方法.
     */
    public void setDoctorId(Long doctorId) {
        this.doctorId = doctorId;
    }

    /**
     * @return Integer 取得域 agencyId 的方法。
     */
    @Column(name = "agency_id", nullable = false)
    public Integer getAgencyId() {
        return this.agencyId;
    }

    /**
     * @param agencyId 对域 agencyId 的设置方法.
     */
    public void setAgencyId(Integer agencyId) {
        this.agencyId = agencyId;
    }

    @Column(name = "created_at")
    public Date getCreatedAt() {
        return this.createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    @Column(name = "created_by")
    public String getCreatedBy() {
        return this.createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    @Column(name = "changed_at")
    public Date getChangedAt() {
        return this.changedAt;
    }

    public void setChangedAt(Date changedAt) {
        this.changedAt = changedAt;
    }

    @Column(name = "changed_by")
    public String getChangedBy() {
        return this.changedBy;
    }

    public void setChangedBy(String changedBy) {
        this.changedBy = changedBy;
    }

    @Version
    public Integer getVersion() {
        return this.version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

}
